<template>
  <div class="pagination">
    <el-pagination
      background
      layout="total, prev, pager, next"
      :total="total"
      :page-size="pageSize"
      @current-change="currentChange"
      :current-page="currentPage"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    total: {
      type: Number,
      default: 0,
    },
    pageSize: {
      type: Number,
      default: 1,
    },
    currentPage: {
      type: Number,
      default: 1
    }
  },
  methods: {
    currentChange(pageNum) {
        this.$emit('changePage', pageNum)
    }
  }
};
</script>

<style lang="less" scoped>
.pagination {
  padding: 10px 0;
  text-align: center;
}
</style>
